import service from '@/utils/request.js'

/** 手机密码登录
 * @param { string|required } userCode
 * @param { string|required } password
*/
export function loginByPassword (data) {
    return service({
        url: '/api/user/login',
        method: 'post',
        data
    })
}

/** 手机验证码登录
 * @param { string|required } mobile
 * @param { string|required } vcode
*/
export function loginByCode (data) {
    return service({
        url: '/api/user/LoginBycode',
        method: 'post',
        data
    })
}

/** 获取验证码
 * @param { phone|required } mobile
*/
export function getcode (data) {
    return service({
        url: '/api/user/getcode',
        method: 'post',
        data
    })
}

// 退出登录
export function Logout () {
    return service({
        url: '/api/user/logout',
        method: 'post'
    })
}


/** 店铺列表
 *@param { string|number } page
 *@param { string|number } size
 *@param { string } keyword  
*/
export function shopList (data) {
    return service({
        url: '/api/index/shoplist',
        method: 'post',
        data
    })
}